package com.zs.dbmonitor.model;

import io.debezium.connector.sqlserver.SqlServerConnector;
import lombok.Data;

import java.util.Map;

/**
 * @author ZhaoShuai
 * @version 1.0
 * @description: TODO
 * @date 2024/6/20 14:00
 */
public class ChangeDataModel {
    /**
     * 更改前数据
     */
    private Map<String, Object> after;
    private Map<String, Object> source;
    /**
     * 更改后数据
     */
    private Map<String, Object> before;
    /**
     * 更改的表名
     */
    private String table;
    /**
     * 操作类型, 枚举 Envelope.Operation
     */
    private String operationType;

    public ChangeDataModel() {
    }

    public Map<String, Object> getAfter() {
        return after;
    }

    public void setAfter(Map<String, Object> after) {
        this.after = after;
    }

    public Map<String, Object> getSource() {
        return source;
    }

    public void setSource(Map<String, Object> source) {
        this.source = source;
    }

    public Map<String, Object> getBefore() {
        return before;
    }

    public void setBefore(Map<String, Object> before) {
        this.before = before;
    }

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getOperationType() {
        return operationType;
    }

    public void setOperationType(String operationType) {
        this.operationType = operationType;
    }

    @Override
    public String toString() {
        return "ChangeDataModel{" + '\n' +
                "   after=" + after + '\n' +
                "   source=" + source + '\n' +
                "   before=" + before + '\n' +
                "   table='" + table + "'\n" +
                "   operationType='" + operationType + "'\n" +
                '}';
    }
}